<h3>店长博客</h3>
<script language="javascript">
var grid;
var ds;

Ext.onReady(function(){
	init_grid();   
});

function init_grid() {
    ds = new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({url: '/admin/blog/blogs_grid'}),
		
        reader: new Ext.data.JsonReader({
            root: 'Blogs',
            totalProperty: 'Total',
            id: 'id'
        }, [
            {name: 'title', mapping: 'title'},
            {name: 'created_on', mapping: 'created_on'}
        ]),        
        // turn on remote sorting
        remoteSort: true	
    });

    var cm = new Ext.grid.ColumnModel
    	([{
           id: 'title',
           header: "标题",
           dataIndex: 'title',
           width: 250},
           {
           header: "创建日期",
           dataIndex: 'created_on',
           width: 250}
           ]);
        
    cm.defaultSortable = true;

    grid = new Ext.grid.Grid('blogs_grid', {
        ds: ds,
        cm: cm,
        selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
		autoExpandColumn: 'title'
    });

    grid.render();    
    ds.load({params:{start:0, limit:20}});	
}
</script>

<div id="blogs_grid" style="border:5px solid #99bbe8; overflow:hidden; width:550px;"></div>